package com.test;

import org.apache.ibatis.type.JdbcType;
import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.context.annotation.Bean;
import org.springframework.transaction.annotation.EnableTransactionManagement;

import tk.mybatis.mapper.autoconfigure.ConfigurationCustomizer;

/**
 * Created by hackerdom on 2018.6.27.<br>
 */
@SpringBootApplication
@EnableTransactionManagement
public class MiniApp {
	public static void main(String[] args) {
		SpringApplication.run(MiniApp.class, args);
	}

	@Bean
	public ConfigurationCustomizer configurationCustomizer() {
		return new ConfigurationCustomizer() {
			@Override
			public void customize(org.apache.ibatis.session.Configuration configuration) {
				//configuration.setCacheEnabled(true);
				configuration.setMapUnderscoreToCamelCase(true);
				configuration.setCallSettersOnNulls(true);
				configuration.setJdbcTypeForNull(JdbcType.NULL);
			}
		};
	}

}
